package com.first.system.controller;

import com.first.common.pojo.CrmBanner;
import com.first.common.pojo.EduCourse;
import com.first.common.pojo.TbZone;
import com.first.common.pojo.TbZoneCourse;
import com.first.common.vo.Result;
import com.first.system.service.ZoneCourseService;
import com.first.system.vo.ZoneCourseVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * @program: first-project
 * @description:
 * @author: 闫锦超
 * @create: 2023-05-29 15:11
 **/
@RestController
@RequestMapping("/home/zone-course/")
@Api(tags = "查询专区的课程")
public class ZoneCourseController {
    @Autowired
    private ZoneCourseService zoneCourseService;
    @PostMapping("/getAllDetail/{currentPage}/{pageSize}")
    @ApiOperation(value = "获取专区的课程信息")
    public Result getAllDetail(@PathVariable Integer currentPage,@PathVariable Integer pageSize, @RequestBody ZoneCourseVo zoneCourseVo){
     return zoneCourseService.findZoneCourse(currentPage,pageSize,zoneCourseVo);
    }

    @PostMapping("/findCourse/{currentPage}/{pageSize}")
    @ApiOperation(value = "查询所有的课程")
    public Result findCourse(@PathVariable Integer currentPage,@PathVariable Integer pageSize,@RequestBody ZoneCourseVo zoneCourseVo){
        return zoneCourseService.findCourse(currentPage,pageSize,zoneCourseVo);
    }

    @PostMapping("/deleteZoneCourse")
    @ApiOperation(value = "删除课程")
    public Result deleteZoneCourse(@RequestBody EduCourse eduCourse){
        return zoneCourseService.deleteZoneCourse(eduCourse);
    }

    @PostMapping("/addCourseDetail")
    @ApiOperation(value = "选择前端要展示的课程")
    public Result addCourseDetail(@RequestBody TbZoneCourse tbZoneCourse){
      return  zoneCourseService.addCourseDetail(tbZoneCourse);
    }

    @PostMapping("/changeStatus/{tzcid}/{tzcisDisable}")
    @ApiOperation(value = "修改专区里的课程状态")
    public Result changeStatus(@PathVariable String tzcid,@PathVariable Integer tzcisDisable){
        return zoneCourseService.changeStatus(tzcid,tzcisDisable);
    }

}
